package com.hongxun.greenentity.sg;

import com.hongxun.budget.utils.StringUtils;
import com.hongxun.greenentity.tk.BDeviceEntity;
import com.hongxun.greenentity.tk.BMaterialEntity;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

import java.io.Serializable;


/**
 * 物资清单
 *
 * @author zkcn
 * @email youeremail@163.com
 * @date 2018-09-03 09:57:27
 */
@Entity
public class CGoodsDetailEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    //guid
    @Id
    private String guid;
    //所属项目ID
    private String pGuid;
    //所属到货记录id
    private String aRGuid;
    //类别(材料/设备)
    private String gDType;
    //所属设备/材料ID
    private String mDGuid;
    //到货数(BigDecimal-double)
    private Double gDNum;
    //供货商
    private String gDBusine;
    //物质编码
    private String gDCode;
    //材料大类
    private String gDBigtype;
    //材料中类
    private String gDMidtype;
    //材料标签
    private String gDLabel;
    //材料名称
    private String gDName;
    //主要技术参数
    private String gDParameter;
    //单位
    private String gDUnit;
    //购置总价
    private Double gDAllprice;
    //购置单价
    private Double gDPrice;
    //单重（kg）
    private Double gDWeight;
    //状态
    private String gDDatastate;

    public CGoodsDetailEntity toCGoodsDetailEntity(BDeviceEntity entity) {
        guid = StringUtils.getUuid();
        gDType = "设备";
        mDGuid = entity.getGuid();
//        gDNum=0.0;//手输
//        gDBusine="";//手输
        gDCode = entity.getDCode();
        gDBigtype = entity.getDBigtype();
        gDMidtype = entity.getDMidtype();
        gDLabel = entity.getDLabel();
        gDName = entity.getDName();
        gDParameter = entity.getDParameter();
        gDUnit = entity.getDUnit();
//        gDAllprice = 0;//计算
        gDPrice = entity.getDPrice();
        gDWeight = entity.getDWeight();
        gDDatastate = "新增";
        return this;
    }

    public CGoodsDetailEntity toCGoodsDetailEntity(BMaterialEntity entity) {
        guid = StringUtils.getUuid();
        gDType = "材料";
        mDGuid = entity.getGuid();
//        gDNum=0.0;//手输
//        gDBusine="";//手输
        gDCode = entity.getMCode();
        gDBigtype = entity.getMBigtype();
        gDMidtype = entity.getMMidtype();
        gDLabel = entity.getMLabel();
        gDName = entity.getMName();
        gDParameter = entity.getMParameter();
        gDUnit = entity.getMUnit();
//        gDAllprice = 0;//计算
        gDPrice = entity.getMPrice();
        gDWeight = entity.getMWeight();
        gDDatastate = "新增";
        return this;
    }

    @Generated(hash = 721051686)
    public CGoodsDetailEntity(String guid, String pGuid, String aRGuid,
            String gDType, String mDGuid, Double gDNum, String gDBusine,
            String gDCode, String gDBigtype, String gDMidtype, String gDLabel,
            String gDName, String gDParameter, String gDUnit, Double gDAllprice,
            Double gDPrice, Double gDWeight, String gDDatastate) {
        this.guid = guid;
        this.pGuid = pGuid;
        this.aRGuid = aRGuid;
        this.gDType = gDType;
        this.mDGuid = mDGuid;
        this.gDNum = gDNum;
        this.gDBusine = gDBusine;
        this.gDCode = gDCode;
        this.gDBigtype = gDBigtype;
        this.gDMidtype = gDMidtype;
        this.gDLabel = gDLabel;
        this.gDName = gDName;
        this.gDParameter = gDParameter;
        this.gDUnit = gDUnit;
        this.gDAllprice = gDAllprice;
        this.gDPrice = gDPrice;
        this.gDWeight = gDWeight;
        this.gDDatastate = gDDatastate;
    }
    @Generated(hash = 247865102)
    public CGoodsDetailEntity() {
    }
    public String getGuid() {
        return this.guid;
    }
    public void setGuid(String guid) {
        this.guid = guid;
    }
    public String getPGuid() {
        return this.pGuid;
    }
    public void setPGuid(String pGuid) {
        this.pGuid = pGuid;
    }
    public String getARGuid() {
        return this.aRGuid;
    }
    public void setARGuid(String aRGuid) {
        this.aRGuid = aRGuid;
    }
    public String getGDType() {
        return this.gDType;
    }
    public void setGDType(String gDType) {
        this.gDType = gDType;
    }
    public String getMDGuid() {
        return this.mDGuid;
    }
    public void setMDGuid(String mDGuid) {
        this.mDGuid = mDGuid;
    }
    public Double getGDNum() {
        return this.gDNum;
    }
    public void setGDNum(Double gDNum) {
        this.gDNum = gDNum;
    }
    public String getGDBusine() {
        return this.gDBusine;
    }
    public void setGDBusine(String gDBusine) {
        this.gDBusine = gDBusine;
    }
    public String getGDCode() {
        return this.gDCode;
    }
    public void setGDCode(String gDCode) {
        this.gDCode = gDCode;
    }
    public String getGDBigtype() {
        return this.gDBigtype;
    }
    public void setGDBigtype(String gDBigtype) {
        this.gDBigtype = gDBigtype;
    }
    public String getGDMidtype() {
        return this.gDMidtype;
    }
    public void setGDMidtype(String gDMidtype) {
        this.gDMidtype = gDMidtype;
    }
    public String getGDLabel() {
        return this.gDLabel;
    }
    public void setGDLabel(String gDLabel) {
        this.gDLabel = gDLabel;
    }
    public String getGDName() {
        return this.gDName;
    }
    public void setGDName(String gDName) {
        this.gDName = gDName;
    }
    public String getGDParameter() {
        return this.gDParameter;
    }
    public void setGDParameter(String gDParameter) {
        this.gDParameter = gDParameter;
    }
    public String getGDUnit() {
        return this.gDUnit;
    }
    public void setGDUnit(String gDUnit) {
        this.gDUnit = gDUnit;
    }
    public Double getGDAllprice() {
        return this.gDAllprice;
    }
    public void setGDAllprice(Double gDAllprice) {
        this.gDAllprice = gDAllprice;
    }
    public Double getGDPrice() {
        return this.gDPrice;
    }
    public void setGDPrice(Double gDPrice) {
        this.gDPrice = gDPrice;
    }
    public Double getGDWeight() {
        return this.gDWeight;
    }
    public void setGDWeight(Double gDWeight) {
        this.gDWeight = gDWeight;
    }
    public String getGDDatastate() {
        return this.gDDatastate;
    }
    public void setGDDatastate(String gDDatastate) {
        this.gDDatastate = gDDatastate;
    }



}
